<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="java.net.URLEncoder"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<link type="text/css" rel="StyleSheet"
	href="<%=basePath%>/style/face.css" />

<script type="text/javascript" src="<%=basePath%>/system/hands.js"></script>
<table class="mainTable" border="0" align="center" cellpadding="0"
	cellspacing="1" bgcolor="#ffb19b">
	<tr>
		<td class="listTitleBg" colspan="2">
			<div class="listTitleLeftBg">
				<s:property value="nav" escape="false"/>
			</div>
			<div class="listTitleRightBg">
				<a href="#"><img src="images/pic22.jpg" width="55" height="26" />
				</a>
			</div>
		</td>
	</tr>
	<tr>
		<td bgcolor="#FFFFFF" class="paddingTB" colspan="2">
			<table width="100%" cellpadding="0" cellspacing="0">
				<tr>
					<td colspan="2">
						驱动器:${drivers}
					</td>
				</tr>
				<tr>
					<td colspan="2">
						当前路径:${currentPath}
					</td>
				</tr>
				<tr>
					<td>
						${navigation}
					</td>
					<td align="right">
						文件名过滤:
						<input name="filt" type="text" class="text"
							onkeyup="filter(this);">
					</td>
				</tr>
			</table>
			<div style="background-color: #DEDEDE">
				<table width="100%" cellpadding="1" cellspacing="1" id="Filetable">
					<thead>
						<tr bgcolor="#CCCCCC">
							<td width="2%" align="center">
								<input name="selall" type="checkbox"
									onClick="selectAll(this.form);" class="checkbox">
							</td>
							<td width="49%">
								Name:
							</td>
							<td width="9%">
								Size:
							</td>
							<td width="17%">
								Last modified:
							</td>
							<td width="5%">
								Edit:
							</td>
							<td width="8%">
								Rename:
							</td>
							<td width="10%">
								DownLoad:
							</td>
						</tr>
					</thead>
					<tbody>
						<s:iterator id="file" value="%{list}" status="stuts">
							<tr style="background-color: #FFFFFF"
								onMouseOver="selectRow(this,0);" onMouseOut="selectRow(this,1);"
								onmouseup="selectRow(this,2);">
								<td align="center">
									<s:checkbox name="#file.url" onmousedown="dis()"
										cssClass="checkbox"></s:checkbox>
								</td>
								<td>
									<s:if test="#file.isfile==0">
										<img src='<%=basePath%>/images/folder.gif' align="middle"
											style="margin-left: 4px;">
											<a href="serverAdmin.do?path=<s:property value="#file.url"/> "
										onmousedown="dis();"> <s:property value="#file.name" /> </a>
									</s:if>
									<s:else>
										<img src='<%=basePath%>/images/file.gif' align="middle"
											style="margin-left: 4px;">
											<a href="viewer.do?path=<s:property value="#file.url"/> "
										onmousedown="dis();"> <s:property value="#file.name" /> </a>
									</s:else>
									
								</td>
								<td>
									<s:if test="#file.isfile==0">
									文件夹
								</s:if>
									<s:else>
										<s:property value="#file.size" />
									</s:else>
								</td>
								<td>
									<s:property value="#file.xgsj" />
								</td>
								<td>
									<s:if test="#file.isfile==0">
									-
								</s:if>
									<s:else>
										<a href="edit.do?path=<s:property value="#file.url" />"
											onmousedown="dis();" target="_blank">edit</a>
									</s:else>
								</td>
								<td>
									<a href="#tool" onmousedown="dis();"
										onClick="showDivValue('Div_rename','<s:property value="#file.name" />');">重命名</a>
								</td>
								<td>
									<s:if test="#file.isfile==0">
									-
								</s:if>
									<s:else>
										<a
											href="serverAdmin.do?download=<s:property value="#file.url" />"
											onmousedown="dis();"> 下载 </a>
									</s:else>
								</td>
							</tr>
						</s:iterator>
					</tbody>
				</table>
			</div>

			<div style="background-color: #CCCCCC;">
				共计:
				<img src='./images/folder.gif' align="middle">
				:${totalFolder },
				<img src='./images/file.gif' align="middle">
				:${totalField } 
			</div>
			<br>
			<a name="tool"></a>
			<b style="color: #666666">操作选中的文件:</b>
			<br>
			<input type="hidden" name="path" value="<%=path%>">
			<span id="Div_movefile_span"> <a href="#tool"
				onclick="javascript:showDiv('Div_movefile');">Move</a> </span>|
			<span id="Div_copyfile_span"> <a href="#tool"
				onclick="javascript:showDiv('Div_copyfile');">Copy</a> </span>|
			<span id="Div_deletefile_span"> <a href="#tool"
				onclick="javascript:showDiv('Div_deletefile');">Delete</a> </span>|
			<span> <a href="#tool" onclick="javascript:disableAll();">Hide
					ToolList</a> </span>
			<!--Move File-->
			<div id="Div_movefile"
				style="display: none; margin-top: 3px; LETTER-SPACING: 0px">
				<b>移动文件(Move File)</b>
				<br>
				移动选中的文件到你填写的目标路径下
				<br>
				请输入移动的目标路径(如 "c:\abc\"):
				<br>
				<input type="text" name="mvFilePath" size="90" class="text">
				<br>
				<input type="submit" name="submit" value="MoveFile" class="button2">
				<hr>
			</div>
			<!---->
			<!--Copy File-->
			<div id="Div_copyfile"
				style="display: none; margin-top: 3px; LETTER-SPACING: 0px">
				<b>复制文件(Copy File)</b>
				<br>
				复制选中的文件到你填写的目标路径下
				<br>
				请输入复制的目标路径(如 "c:\abc\"):
				<br>
				<input type="text" name="cpFilePath" size="90" class="text">
				<br>
				<input type="submit" name="submit" value="CopyFile" class="button2">
				<hr>
			</div>
			<!---->
			<!--Delete File-->
			<div id="Div_deletefile"
				style="display: none; margin-top: 3px; LETTER-SPACING: 0px">
				<b>删除文件(Delete File)</b>
				<br>
				这是一项危险的操作,文件一旦被删除就不能恢复了
				<br>
				强烈建议你重新检查一次选中的文件,或者使用重命名代替删除.
				<br>
				如果你确定要这么做,点击下面按钮,选中的文件将被彻底删除.
				<br>
				<input type="submit" name="submit" class="button2" value="Delete"
					onclick="return confirm('你确定要删除这些文件?')">
				<hr>
			</div>
			<!---->
		<div style="margin-top: 3px; color: #666666;">
			<b>操作当前目录:</b>
		</div>
		<span id="Div_upload_span"> <a href="#tool"
			onclick="javascript:showDiv('Div_upload');">Upload</a> </span>|
		<span id="Div_newfolder_span"> <a href="#tool"
			onclick="javascript:showDiv('Div_newfolder');">Create Folder</a> </span>|
		<span id="Div_newfile_span"> <a href="#tool"
			onclick="javascript:showDiv('Div_newfile');">Create File</a> </span>|
		<span id="Div_rename_span"> <a href="#tool"
			onclick="javascript:showDiv('Div_rename');">Rename</a> </span>|
		<span id="Div_extension_span"> <a href="#tool"
			onclick="javascript:showDiv('Div_extension');">Extensions</a> </span>
		<!--upload-->
		<div id="Div_upload"
			style="display: none; margin-top: 3px; LETTER-SPACING: 0px">
			<b>上传文件(Upload)</b>
			<br>
			你将上传一个文件到:
			<font color=red><%=path%></font>
			<br>
			<form method="POST"
				action="serverAdmin.do?path=<%=URLEncoder.encode(path,"utf-8")%>"
				enctype="multipart/form-data">
				<input type="file" name="upfile" size="50" class="text">
				<br>
				<input type="submit" value="Upload" class="button2">
			</form>
			<hr>
		</div>
		<!---->
		<!--Create Folder-->
		<div id="Div_newfolder"
			style="display: none; margin-top: 3px; LETTER-SPACING: 0px">
			<b>创建一个新文件夹(Create Folder)</b>
			<br>
			你将创建一个新文件夹在:
			<font color=red><%=path%></font>
			<br>
			<form method="POST" action="serverAdmin.do">
				<input type="hidden" name="path" value="<%=path%>">
				please enter新文件夹的名称:(不要含有 \ / : * ? " < > |)
				<br>
				<input type="text" name="crFolderName" size="50" class="text">
				<br>
				<input type="submit" name="submit" value="CreateFolder"
					class="button2">
			</form>
			<hr>
		</div>
		<!---->
		<!--Create File-->
		<div id="Div_newfile"
			style="display: none; margin-top: 3px; LETTER-SPACING: 0px">
			<b>创建一个新文件(Create File)</b>
			<br>
			你将创建一个新文件在:
			<font color=red><%=path%></font>
			<br>
			<form method="POST" action="serverAdmin.do">
				<input type="hidden" name="path" value="<%=path%>">
				please enter新文件的名称: (如"abc.txt",并且不要含有 \ / : * ? " < > |)
				<br>
				<input type="text" name="crFileName" size="50" class="text">
				<br>
				<input type="submit" name="submit" value="CreateFile"
					class="button2">
			</form>
			<hr>
		</div>
		<!---->
		<!--rename-->
		<div id="Div_rename"
			style="display: none; margin-top: 3px; LETTER-SPACING: 0px">
			<b>重命名一个文件夹或文件(Rename)</b>
			<br>
			你将重命名一个文件夹或文件在:
			<font color=red><%=path%></font>
			<br>
			<form method="POST" action="serverAdmin.do">
				<input type="hidden" name="path" value="<%=path%>">
				<input type="hidden" id="Div_rename_hidden" name="oldFileName">
				请先点击文件列表右边对应的"重命名"连接,然后在此对话框中更改文件名称:(不要含有 \ / : * ? " < > |)
				<br>
				<input type="text" id="Div_rename_input" name="newFileName"
					size="50" class="text">
				<br>
				<input type="submit" name="submit" value="Rename" class="button2">
			</form>
			<hr>
		</div>
		<!---->
		<!--about-->
		<div id="Div_extension"
			style="display: none; margin-top: 3px; LETTER-SPACING: 0px">
			<b>扩展功能(Extensions)</b>
			<br>
			<a href="tool.do?path=" target="_blank">[upload
				tools]</a>&nbsp;&nbsp;
			<a href="cmd.do?path=<%=path%>" target="_blank">[win
				cmd]</a>&nbsp;&nbsp;
			<br>
			<hr>
		</div>
</table>
